<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <!-- <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script> -->
    <script src="./node_modules/vue/dist/vue.js"></script>
  </head>
  <body>
    <div id="app">
      <ul>
        <!-- <li>{{users[0].name}}</li> -->
        <!-- <li>{{users[1].name}}</li> -->
        <!-- <li v-for="(user,index) in users">
          {{index}} -- {{user.name}} --{{user.age}}
        </li> -->

        <li v-for="(user,key,index) in userInfo">
          {{user.name}} --{{user.age}} -- {{key}} --{{index}}
        </li>
      </ul>
    </div>
    <script>
      // js
      // for of for for in foreach

      // vue
      //  in
      const app = new Vue({
        el: "#app",
        data: {
          // users: [
          //   {
          //     name: "xiaohong",
          //     age: 13,
          //   },
          //   {
          //     name: "xiaohei",
          //     age: 15,
          //   },
          //   {
          //     name: "xiaohu",
          //     age: 22,
          //   },
          // ],

          userInfo: {
            xiaohong: {
              name: "xiaohong",
              age: 13,
            },
            xiaohei: {
              name: "xiaohei",
              age: 15,
            },
            xiaohu: {
              name: "xiaohu",
              age: 22,
            },
          },
        },
      });

      console.log(app);
    </script>
  </body>
</html>
